Skip to content

test(orchestrate-sdlc): isolate worktree-control-test from host git config - #1178

Draft
sbalabanov wants to merge 1 commit into
mainfrom
sergeyb/test-worktree-control-host-git-isolation
Draft

sbalabanov wants to merge 1 commit into
mainfrom
sergeyb/test-worktree-control-host-git-isolation

Conversation

@sbalabanov

Copy link
Copy Markdown
Collaborator

TLDR: worktree-control-test no longer reads host system or global git config, so hosts that install git hooks no longer push it past its 60 s timeout.

Summary

  • The test timed out at its 60 s limit in 8 of 20 baseline runs, and 2 of 50 per alias under CPU load.
  • Both its own git calls and those of the code under test inherit the host's system git config. A system config that installs hooks (core.hooksPath) runs them on every commit and checkout, about 0.5 s per commit against about 0.05 s isolated.
  • setUp now starts the environment patch before the first git call and adds GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null. Identity and signing stay set through the -c options. Only worktree_control_test.py changes.

Test Plan

  • Before the fix, on a host with system git hooks: ./tool/bazel test //.agents/skills/orchestrate-sdlc/scripts:worktree-control-test --nocache_test_results PASSED in 50.0s.
  • After the fix, the same command passed in 3.1s and 3.8s.
  • Under load, with 16 busy loops running: ./tool/bazel test //.agents/skills/orchestrate-sdlc/scripts:worktree-control-test //.claude/skills/orchestrate-sdlc/scripts:worktree-control-test --runs_per_test=50 --runs_per_test_detects_flakes --nocache_test_results --local_test_jobs=24. Result: 100/100 pass.
    • agents alias: Stats over 50 runs: max = 4.8s, min = 3.7s, avg = 4.4s, dev = 0.3s
    • claude alias: Stats over 50 runs: max = 3.9s, min = 3.1s, avg = 3.8s, dev = 0.2s
  • pew-test, watch-control-test and worktree-control-test all pass.
  • make lint check-gazelle passes.

🤖 Generated with Claude Code

…onfig

The worktree-control test timed out at its 60 s limit in 8 of 20 baseline runs and in 2 of 50 per alias under CPU load.

Its own git calls and those of the code under test inherit the host's system git config. A system config that installs hooks (core.hooksPath) runs them on every commit and checkout, costing about 0.5 s per commit against about 0.05 s isolated, so the suite took 36-50 s locally against a few seconds in CI.

setUp now starts the environment patch before the first git call and sets GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null, so every git process the test or the code under test starts ignores system and global config. Identity and signing stay set through the -c options in GIT.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flaky-1-f4-reviewer] satisfied: the environment patch now starts before the first git call and covers every git process the test and worktree_control.py spawn, with cleanup registered right after start; no behavior, scope, comment-rule or PR-body issues found.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant